import request from '@/utils/request'

// 目录列表
export function directorysList(params) {
  return request({
    url: '/directorys',
    method: 'GET',
    params
  })
}
// 新增
export function addDirectorys(data) {
  return request({
    url: '/directorys',
    method: 'POST',
    data
  })
}
// 数据详情 id
export function directoryDetail(id) {
  return request({
    url: `/directorys/${id}`,
    method: 'GET',
  })
}
// 修改
export function updateDirectory(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除
export function delDirectory(id) {
  return request({
    url: `/directorys/${id}`,
    method: 'DELETE',
  })
}
// 目录状态
export function stateDirectory(id, state) {
  return request({
    url: `/directorys/${id}/${state}`,
    method: 'POST',
  })
}
// 目录简单列表
export function simpleDirectory(id) {
  return request({
    url: `/directorys/simple?subjectID=${id}`,
    method: 'GET'
  })
}